package com.ihy.service.impl;

import com.ihy.dao.mybatis.DaoClause;
import com.ihy.entity.Clause;
import com.ihy.service.ServiceClause;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class ServiceClauseImpl implements ServiceClause {
    @Autowired
    private DaoClause daoClause;

    @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
    @Override
    @Cacheable(key = "'clauseIdIs'+#p0", value = "redisCacheTime")
    public Clause getClause(int id) {
        return daoClause.getClause(id);
    }
}
